package com.mtiiot.fstcpclient.utils;

import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * Created by lcy on 16-5-26.
 */
public class Constants {
    private static final Logger logger = LogManager.getLogger(Constants.class);
    private static String tcpIp;
    private static int tcpPort;
    private static String sysName;
    private static String applicationKey;

    static {
        Properties p = new Properties();
        InputStream in = Constants.class.getResourceAsStream("/config.properties");
        try {
            p.load(in);
            tcpIp=p.getProperty("ftp.ip");
            tcpPort=Integer.parseInt(p.getProperty("ftp.port"));
            sysName = p.getProperty("sysName");
            applicationKey=p.getProperty("applicationKey");
        } catch (IOException e) {
            logger.error(e.getMessage());
        }
    }

    public static  String getTcpIp(){
        return tcpIp;
    }

    public static int getTcpPort(){
        return tcpPort;
    }

    public static String getSysName(){
        return sysName;
    }

    public static String getApplicationKey(){
        return applicationKey;
    }

}
